import { request } from "@tarojs/taro";
import { REQUEST } from "./types";

export const port = process.env.REACT_APP_PORT || 3002;
export const baseUrl = `https://hongbin.xyz:${port}`;
// export const baseUrl = `http://localhost:${port}`;
export const baseRoute = `${baseUrl}/#/`;
export const previewUrl = `${baseRoute}preview/`;
export const imgBaseUrl = `${baseUrl}${REQUEST.GET_IMAGE}`;

export const createCode = async (data) => {
  return await request({
    url: baseUrl + "/wc_createQRCode",
    data,
    method: "POST",
    dataType: "json",
  });
};
